package org.hot100_3;

public class leetcode24 {
    public ListNode swapPairs(ListNode head) {
        if (head==null || head.next==null){
            return head;
        }

        ListNode first = head;

        ListNode next = head.next;

        ListNode temp = next.next;

        next.next=first;

        first.next=swapPairs(temp);

        return next;
    }
}
